package com.example.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.enums.IdType;
import com.example.annotation.Unique;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Set;

/**
 * <p>
 *
 * </p>
 *
 * @author zk
 * @since 2019-07-01
 */
public class Account implements Serializable {

    private static final long serialVersionUID = 1L;

    private String uuid;
    @TableId(value = "acc_no", type = IdType.AUTO)
    private Integer accNo;
    private String pid;
    @Unique(message = "login_name_repeat")
    private String logonName;
    //十六进制
    @Unique(message = "card_no_unique")
    private String cardNo;
    @Max(value = Integer.MAX_VALUE, message = "card_no_invalid")
    @Min(value = Integer.MIN_VALUE, message = "card_no_invalid")
    private Integer cardId;
    private String idCard;
    @NotNull(message = "enter_user_name")
    private String trueName;
    private Integer kind;
    private Integer ident;
    //1正常 2 非正常
    private Integer status;
    private Integer localstatus;
    @NotNull(message = "choose_class")
    private Integer classId;
    @TableField(exist = false)
    private Integer consoleId;
    private String password;
    private Integer expiredDate;
    private Integer balance;
    private Integer subsidy;
    private Integer freeTime;
    private Integer useQuota;
    private Integer sex;
    private Integer birthday;
    private String tel;
    private String handPhone;
    @Email(message = "email_pattern_error")
    private String email;
    private String msn;
    private String qq;
    private String homeAddr;
    private String curAddr;
    private String curZip;
    // 1表示用户已修改密码
    private Integer property;
    private String memo;
    private Date gmtCreate;
    private Date gmtModified;
    @TableField(exist = false)
    private String className;
    @TableField(exist = false)
    private String deptSn;
    @TableField(exist = false)
    private String deptName;
    @TableLogic
    private Integer isDel;
    @TableField(exist = false)
    private Set<String> permsSet;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(exist = false)
    private LocalDateTime inLibraryTime;
    @TableField(exist = false)
    private String consoleName;
    //入馆截止时间，单向闸机才有
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime stayEndTime;
    @TableField(exist = false)
    private Integer location;

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Integer getAccNo() {
        return accNo;
    }

    public void setAccNo(Integer accNo) {
        this.accNo = accNo;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getLogonName() {
        return logonName;
    }

    public void setLogonName(String logonName) {
        this.logonName = logonName;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public Integer getCardId() {
        return cardId;
    }

    public void setCardId(Integer cardId) {
        this.cardId = cardId;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public Integer getConsoleId() {
        return consoleId;
    }

    public void setConsoleId(Integer consoleId) {
        this.consoleId = consoleId;
    }

    public String getTrueName() {
        return trueName;
    }

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    public Integer getKind() {
        return kind;
    }

    public void setKind(Integer kind) {
        this.kind = kind;
    }

    public Integer getIdent() {
        return ident;
    }

    public void setIdent(Integer ident) {
        this.ident = ident;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getLocalstatus() {
        return localstatus;
    }

    public void setLocalstatus(Integer localstatus) {
        this.localstatus = localstatus;
    }

    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getExpiredDate() {
        return expiredDate;
    }

    public void setExpiredDate(Integer expiredDate) {
        this.expiredDate = expiredDate;
    }

    public Integer getBalance() {
        return balance;
    }

    public void setBalance(Integer balance) {
        this.balance = balance;
    }

    public Integer getSubsidy() {
        return subsidy;
    }

    public void setSubsidy(Integer subsidy) {
        this.subsidy = subsidy;
    }

    public Integer getFreeTime() {
        return freeTime;
    }

    public void setFreeTime(Integer freeTime) {
        this.freeTime = freeTime;
    }

    public Integer getUseQuota() {
        return useQuota;
    }

    public void setUseQuota(Integer useQuota) {
        this.useQuota = useQuota;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getBirthday() {
        return birthday;
    }

    public void setBirthday(Integer birthday) {
        this.birthday = birthday;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getHandPhone() {
        return handPhone;
    }

    public void setHandPhone(String handPhone) {
        this.handPhone = handPhone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMsn() {
        return msn;
    }

    public void setMsn(String msn) {
        this.msn = msn;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getHomeAddr() {
        return homeAddr;
    }

    public void setHomeAddr(String homeAddr) {
        this.homeAddr = homeAddr;
    }

    public String getCurAddr() {
        return curAddr;
    }

    public void setCurAddr(String curAddr) {
        this.curAddr = curAddr;
    }

    public String getCurZip() {
        return curZip;
    }

    public void setCurZip(String curZip) {
        this.curZip = curZip;
    }

    public Integer getProperty() {
        return property;
    }

    public void setProperty(Integer property) {
        this.property = property;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getDeptSn() {
        return deptSn;
    }

    public void setDeptSn(String deptSn) {
        this.deptSn = deptSn;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getConsoleName() {
        return consoleName;
    }

    public void setConsoleName(String consoleName) {
        this.consoleName = consoleName;
    }

    public LocalDateTime getInLibraryTime() {
        return inLibraryTime;
    }

    public void setInLibraryTime(LocalDateTime inLibraryTime) {
        this.inLibraryTime = inLibraryTime;
    }

    public LocalDateTime getStayEndTime() {
        return stayEndTime;
    }

    public void setStayEndTime(LocalDateTime stayEndTime) {
        this.stayEndTime = stayEndTime;
    }

    public Integer getLocation() {
        return location;
    }

    public void setLocation(Integer location) {
        this.location = location;
    }

    @Override
    public String toString() {
        return "Account{" +
                "uuid=" + uuid +
                ", accNo=" + accNo +
                ", pid=" + pid +
                ", logonName=" + logonName +
                ", cardNo=" + cardNo +
                ", cardId=" + cardId +
                ", idCard=" + idCard +
                ", trueName=" + trueName +
                ", kind=" + kind +
                ", ident=" + ident +
                ", status=" + status +
                ", classId=" + classId +
                ", password=" + password +
                ", expiredDate=" + expiredDate +
                ", balance=" + balance +
                ", subsidy=" + subsidy +
                ", freeTime=" + freeTime +
                ", useQuota=" + useQuota +
                ", sex=" + sex +
                ", birthday=" + birthday +
                ", tel=" + tel +
                ", handPhone=" + handPhone +
                ", email=" + email +
                ", msn=" + msn +
                ", qq=" + qq +
                ", homeAddr=" + homeAddr +
                ", curAddr=" + curAddr +
                ", curZip=" + curZip +
                ", memo=" + memo +
                ", gmtCreate=" + gmtCreate +
                ", gmtModified=" + gmtModified +
                ", isDel=" + isDel +
                "}";
    }

    public Set<String> getPermsSet() {
        return permsSet;
    }

    public void setPermsSet(Set<String> permsSet) {
        this.permsSet = permsSet;
    }
}
